package net.cloudcodex.shared.rpc;

import java.util.Date;
import java.util.List;
import java.util.Map;

import net.cloudcodex.shared.MessageAction;
import net.cloudcodex.shared.dto.Result;
import net.cloudcodex.shared.dto.campaign.character.CharacterDescriptionDTO;
import net.cloudcodex.shared.dto.campaign.character.CharacterHeaderDTO;
import net.cloudcodex.shared.dto.campaign.character.CharacterNoteDTO;
import net.cloudcodex.shared.dto.campaign.character.CompleteCharacterDescriptionDTO;
import net.cloudcodex.shared.dto.home.CampaignSummaryDTO;
import net.cloudcodex.shared.dto.msg.SceneDTO;
import net.cloudcodex.shared.dto.msg.SceneToCreateDTO;

import com.google.gwt.user.client.rpc.AsyncCallback;


/**
 * The async counterpart of <code>CampaignRPC</code>.
 */
public interface CampaignRPCAsync {

	public void createCampaign(String name, String game, 
			String description, String icon,
			AsyncCallback<Result<CampaignSummaryDTO>> callback);
	
	public void updateCampaign(long campaignId, String name, String game, 
			String description, String icon,
			AsyncCallback<Result<CampaignSummaryDTO>> callback);

	public void getMessages(long campaignId, long characterId,
			Long lastSceneId, Date timestamp, 
			AsyncCallback<Result<List<SceneDTO>>> callback);

	public void inviteToCampaign(long campaignId, String email, String name, 
			AsyncCallback<Result<CharacterHeaderDTO>> callback);

	public void addNPC(long campaignId, String name, String description, 
			String icon, boolean profile,
			AsyncCallback<Result<CharacterHeaderDTO>> callback);
	
	public void getCampaignCharacters(long campaignId, 
			AsyncCallback<Result<List<CharacterHeaderDTO>>> callback);

	public void getCharacterDescription(
			long campaignId, long characterId, 
			Long byCharacterId, Date timestamp, 
			AsyncCallback<Result<CharacterDescriptionDTO>> callback);

	public void getCharacterCompleteDescription(
			long campaignId, long characterId,
			AsyncCallback<Result<CompleteCharacterDescriptionDTO>> callback);

	public void updateCharacterDescription(
			long campaignId, long characterId, Long byCharacterId,
			String description, String sheet, Boolean dead, Boolean locked,
			List<CharacterNoteDTO> notes, Map<Long, String> aliases,
			AsyncCallback<Result<CharacterDescriptionDTO>> callback);

	public void startScenes(long campaignId, SceneToCreateDTO[] scenes, 
			AsyncCallback<Result<Boolean>> callback);

	public void justForTestsDoSomethingRandomly(
			long campaignId, long characterId, int action,
			AsyncCallback<Result<Boolean>> callback);

	public void playerPostAction(
			long campaignId, long characterId, 
			long clientSceneId, Date clientSceneTimestamp,
			MessageAction action, String content,
			AsyncCallback<Result<Boolean>> callback);
	
	public void playerPostOFF(
			long campaignId, long characterId, 
			long clientSceneId, Date clientSceneTimestamp,
			String content, 
			AsyncCallback<Result<Boolean>> callback);
	
	public void playerRollDices(
			long campaignId, long characterId, 
			long clientSceneId, Date clientSceneTimestamp,
			Map<Integer, Integer> dices, String content, 
			AsyncCallback<Result<Boolean>> callback);
}
